<template>
  <div>
    <div class="XboxTop">
      <div class="XboxTop_title">告警信息</div>
    </div>
    <div class="XboxTop_con" style="padding: 0 10px;overflow-y: auto;scrollbar-width: none;">
      <div v-for="(item, i) in list" :key="i" class="listcen">
        <div class="listcen_title">{{ item.name }}</div>
        <div class="listcen_val">
          <div class="yjj" :class="`yj${item.warningType}`">{{ getHandle(dict.type.warn_types, item.warningType) }}{{ item.warningType }}</div>
        </div>
      </div>
    </div>
  </div>
</template>
<script>
export default {
  dicts: ["warn_types"],
  //变量
  data() {
    return {
      list: [{
        name: "ssss",
        dz: "地址",
        warningType: 1
      }, {
        name: "ssss",
        dz: "地址",
        warningType: 1
      }],
    };
  },
  //初始
  mounted() { },
  //事件
  methods: {
    init(data) {
      this.list = data
    },
    getHandle(obj, item) {
      if (!item) {
        return;
      }
      let name = "";
      obj.map((val) => {
        if (val.value == item) {
          name = val.label;
        }
      });
      return name;
    },
  },
  //销毁
  beforeDestroy() { },
};
</script>
<style scoped>
.listcen {
  width: 100%;
  display: flex;
  justify-content: space-between;
  color: #fff;
  margin-bottom: 10px;
  background: url("~@/assets/hb_img/bj/gjbj.png") no-repeat;
  background-size: 100% 100%;
}

.listcen_title {
  /* width: 60%; */
  padding: 10px;
  /* background: rgba(0, 78, 163, 0.3); */
}

.listcen_val {
  /* width: 40%; */
  padding: 10px;
  /* background: rgba(0, 78, 163, 0.3);   */

  color: #000;

}

.yjj {
  width: 120px;
  height: 25px;
  border-radius: 10px;
  text-align: center;
  line-height: 25px;
  color: #fff;
  background: rgba(0, 78, 163, 1);
}
.yj1{
  background: #66FFFF ;
  color: #000;
}
.yj2{
  background: #FF6060 ;
}
.yj3{
  background: #FF6060 ;
}
.yj4{
  background: #A3A3A3;

}
</style>
